package com.quanquan.store.repository;

import com.quanquan.store.entity.Activity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 功能描述:活动管理
 *
 * @ClassName: ActivityRepository
 * @Author: xiaoqianh丶
 * @Date: 2019-03-26 17:23
 * @Version: V1.0
 */
@Repository
public interface ActivityRepository extends JpaRepository<Activity,String>, JpaSpecificationExecutor<Activity> {


    /**
     * 根据活动id查询活动
     * @param activcity
     * @param remove
     * @return
     */
    public Activity findByIdAndRemove(String activcity, Integer remove);


    /**
     * 根据活动名称查询活动
     * @param activityName
     * @return
     */
    public Activity findActivityByActivityNameAndRemove(String activityName, Integer remove);


    /**
     * 查询所有未删除的活动
     * @param remove
     * @return
     */
    public List<Activity> findAllByRemove(Integer remove);


    /**
     * 通过Id集合来获取活动
     * @param ids
     * @return
     */
    List<Activity> findAllByIdIn(List<String> ids);

}
